forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3/3]: Implement Consumer
on chainWatcher
and resolvers
#10
Open
yyforyongyu
wants to merge
64
commits into
master
Choose a base branch
from
yy-blockbeat-finalize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 20, 2024 14:57
732d7f8
to
3592aa1
Compare
Pull reviewers statsStats of the last 30 days for lnd:
|
yyforyongyu
force-pushed
the
yy-blockbeat
branch
3 times, most recently
from
June 24, 2024 14:03
f1648f6
to
ba41ee4
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 24, 2024 23:39
0034ee3
to
ced95d8
Compare
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 25, 2024 13:13
ba41ee4
to
7be7745
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 25, 2024 23:50
ced95d8
to
3a163a1
Compare
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 27, 2024 01:29
7be7745
to
6f652ac
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 27, 2024 01:29
3a163a1
to
fa69320
Compare
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 27, 2024 13:47
6f652ac
to
e65366e
Compare
yyforyongyu
changed the title
Implement
[3/3]: Implement Jun 27, 2024
Consumer
on chainWatcher
and resolversConsumer
on chainWatcher
and resolvers
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 27, 2024 18:45
fa69320
to
0cb50f1
Compare
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 27, 2024 19:57
e65366e
to
74cda6e
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 27, 2024 19:59
0cb50f1
to
8e7419f
Compare
Pull Request Test Coverage Report for Build 9702817439Details
💛 - Coveralls |
yyforyongyu
force-pushed
the
yy-blockbeat
branch
from
June 27, 2024 22:05
74cda6e
to
cec4d1e
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
2 times, most recently
from
June 27, 2024 22:48
77cf536
to
da3a542
Compare
yyforyongyu
force-pushed
the
yy-blockbeat
branch
2 times, most recently
from
June 29, 2024 02:18
040d363
to
651886f
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
June 29, 2024 07:37
da3a542
to
b4282fa
Compare
Pull Request Test Coverage Report for Build 9722582087Details
💛 - Coveralls |
yyforyongyu
force-pushed
the
yy-blockbeat
branch
3 times, most recently
from
July 2, 2024 12:47
d7ffa05
to
1db9b94
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
July 4, 2024 12:12
b4282fa
to
6bb765f
Compare
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
2 times, most recently
from
July 10, 2024 18:11
691bb67
to
283e10f
Compare
This `immediate` flag was added as a hack so during a restart, the pending resolvers would offer the inputs to the sweeper and ask it to sweep them immediately. This is no longer need due to `blockbeat`, as now during restart, a block is always sent to all subsystems via the flow `ChainArb` -> `ChannelArb` -> resolvers -> sweeper. Thus, when there are pending inputs offered, they will be processed by the sweeper immediately.
To avoid calling GetBestBlock again.
This is needed so the consumers have an initial state about the current block.
In this commit we start to break up the starting process into smaller pieces, which is needed in the following commit to initialize blockbeat consumers.
Refactor the `Start` method to fix the linter error: ``` contractcourt/chain_arbitrator.go:568: Function 'Start' is too long (242 > 200) (funlen) ```
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
December 10, 2024 07:05
a16b2d4
to
ef85fb5
Compare
We now put the outpoint in the resolvers's logging so it's easier to debug.
This commit adds a few helper methods to decide how the htlc output should be spent.
This commit is a pure refactor in which moves the sweep handling logic into the new methods.
This commit refactors the `Resolve` method by adding two resolver handlers to handle waiting for spending confirmations.
This commit adds new methods to handle making sweep requests based on the spending path used by the outgoing htlc output.
This commit adds checkpoint methods in `htlcTimeoutResolver`, which are similar to those used in `htlcSuccessResolver`.
This commit adds more methods to handle resolving the spending of the output based on different spending paths.
We will use this and its following commits to break the original `Resolve` methods into two parts - the first part is moved to a new method `Launch`, which handles sending a sweep request to the sweeper. The second part remains in `Resolve`, which is mainly waiting for a spending tx. Breach resolver currently doesn't do anything in its `Launch` since the sweeping of justice outputs are not handled by the sweeper yet.
This commit breaks the `Resolve` into two parts - the first part is moved into a `Launch` method that handles sending sweep requests, and the second part remains in `Resolve` which handles waiting for the spend. Since we are using both utxo nursery and sweeper at the same time, to make sure this change doesn't break the existing behavior, we implement the `Launch` as following, - zero-fee htlc - handled by the sweeper - direct output from the remote commit - handled by the sweeper - legacy htlc - handled by the utxo nursery
This commit breaks the `Resolve` into two parts - the first part is moved into a `Launch` method that handles sending sweep requests, and the second part remains in `Resolve` which handles waiting for the spend. Since we are using both utxo nursery and sweeper at the same time, to make sure this change doesn't break the existing behavior, we implement the `Launch` as following, - zero-fee htlc - handled by the sweeper - direct output from the remote commit - handled by the sweeper - legacy htlc - handled by the utxo nursery
When calling `NotifyExitHopHtlc` it is allowed to pass a chan to subscribe to the HTLC's resolution when it's settled. However, this method will also return immediately if there's already a resolution, which means it behaves like a notifier and a getter. If the caller decides to only use the getter to do a non-blocking lookup, it can pass a nil subscriber chan to bypass the notification.
A minor refactor is done to support implementing `Launch`.
This commit makes `resolved` an atomic bool to avoid data race. This field is now defined in `contractResolverKit` to avoid code duplication.
In this commit, we break the old `launchResolvers` into two steps - step one is to launch the resolvers synchronously, and step two is to actually waiting for the resolvers to be resolved. This is critical as in the following commit we will require the resolvers to be launched at the same blockbeat when a force close event is sent by the chain watcher.
We need to offer the outgoing htlc one block earlier to make sure when the expiry height hits, the sweeper will not miss sweeping it in the same block. This also means the outgoing contest resolver now only does one thing - watch for preimage spend till height expiry-1, which can easily be moved into the timeout resolver instead in the future.
yyforyongyu
force-pushed
the
yy-blockbeat-finalize
branch
from
December 10, 2024 07:15
ef85fb5
to
cebad6d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.